package com.lcy.demo.annotation;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * Created by PC on 2017/3/29.
 */
@Repository
public interface UserMapper {
    @Select("SELECT * FROM user WHERE id = #{userId}")
    User getUser(@Param("userId") Integer userId);

    @Insert("insert user(name,age,gender) values(#{name},#{age},#{gender})")
    Integer insertUser(@Param("name") String name,@Param("age") Integer age,@Param("gender") Integer gender);
}
